package ren.kane.phoenix.some.innerclass;

/**
 * 成员内部类.
 *
 * @author renrk(1275) on 2018-10-28 11:08 AM
 **/
public class Circle {

    private double radius = 0;
    private static int count = 1;

    public Circle() {
    }

    public Circle(double radius) {
        this.radius = radius;
        getDrawInstance().drawShape();
    }

    private Draw getDrawInstance() {
        return new Draw();
    }

    public class Draw {
        public void drawShape() {
            System.out.println("draw shape");
            System.out.println(radius);
            System.out.println(count);
        }
    }

    public static void main(String[] args) {
        // type1
        Circle circle = new Circle();
        Circle.Draw draw = circle.new Draw();
        draw.drawShape();

        // type2
        Circle.Draw draw1 = circle.getDrawInstance();
        draw1.drawShape();
    }
}
